package com.qingcloud.adminbackend.entity.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.qingcloud.adminbackend.entity.stationgroup.SysStationGroupVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *
 * </p>
 *
 * @author luozehua
 * @since 2018-11-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_user")
public class SysUser extends Model implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "Id")
    private String Id;
    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名")
    private String fullName;

    @ApiModelProperty(value = "姓名拼音")
    @TableField(value = "full_name_pinyin")
    private String fullNamePinyin;

    /**
     * 登录名
     */
    @ApiModelProperty(value = "登录名")
    private String userName;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    private Integer gender;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    private String userPassword;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    private String workEmail;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    private String mobileno;

    /**
     * 工作地址
     */
    @ApiModelProperty(value = "工作地址")
    private String workAddress;


    /**
     * 默认区域编号
     */
    @ApiModelProperty(value = "默认区域编号")
    private String domainId;

    /**
     * 默认顶级监控对象
     */
    @ApiModelProperty(value = "默认顶级监控对象")
    private String moId;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 1:登录中、2:退出、3:未使用、4:锁定
     */
    @ApiModelProperty(value = "0:未激活、1:登录中、2:退出、3:未使用、4:锁定")
    private String status;

    @ApiModelProperty(value = "0-不能修改登录名，1-能修改一次")
    @TableField(value = "is_default")
    private Integer isDefault;

    /**
     * N：正常；D：已经删除
     */
    @ApiModelProperty(value = "0：正常；1：已经删除")
    private String deleteFlag;

    /**
     * 登录次数
     */
    @ApiModelProperty(value = "登录次数")
    private Integer loginCount;

    /**
     * 最后登录时间
     */
    @ApiModelProperty(value = "最后登录时间")
    private Date lastLoginTime;

    @ApiModelProperty(value = "用户组ID数组")
    @TableField(exist = false)
    private List<String> userGroupIds;

    @ApiModelProperty(value = "角色ID数组")
    @TableField(exist = false)
    private List<String> roleIds;

    /**
     * 用户身份
     */
    @ApiModelProperty(value = "用户身份名称数组")
    @TableField(exist = false)
    private List<String> roleNames;

    /**
     * 业务种类Id
     */
    @ApiModelProperty(value = "用户身份名称数组")
    @TableField(exist = false)
    List<String> businessTypeIdsArr ;

    /**
     * 业务种类Id
     */
    @ApiModelProperty(value = "用户身份名称数组")
    @TableField(exist = false)
    String orgBusinessType ;

    @ApiModelProperty(value = "功能列表")
    @TableField(exist = false)
    List<String> dataFunction ;

    /**
     * 业务种类名称
     */
    @ApiModelProperty(value = "用户身份名称数组")
    @TableField(exist = false)
    List<String> businessTypeNameIdsArr ;

    /**
     * 用户所属客户
     */
    @ApiModelProperty(value = "用户所属客户数组")
    @TableField(exist = false)
    private List<String> orgNames;

    @ApiModelProperty(value = "授权：功能ID列表")
    @TableField(exist = false)
    private List<String> functionIds;

    @ApiModelProperty(value = "授权：设备组ID列表")
    @TableField(exist = false)
    private List<String> stationGroupIds;

    @ApiModelProperty(value = "所属客户列表")
    @TableField(exist = false)
    private List<String> orgIds;

    @ApiModelProperty(value = "授权：用户可管理客户列表")
    @TableField(exist = false)
    private List<String> orgMgrIds;

    /**
     * 访问token
     */
    @ApiModelProperty(value = "访问token")
    private String accessToken;

    private String createBy;

    private Date createDt;

    private String modifyBy;

    private Date modifyDt;

    @ApiModelProperty(value = "用户类型 1健康空气用户 2蛙鸣用户 3网格化用户")
    private Integer userType;

    @ApiModelProperty(value = "登录用户对该用户的所属客户是否有管理权限")
    @TableField(exist = false)
    private Integer orgAuth;

    @ApiModelProperty(value = "所属组织名称")
    @TableField(exist = false)
    private String orgName;

    @ApiModelProperty(value = "所属组织ID")
    @TableField(exist = false)
    private String orgId;

    @ApiModelProperty(value = "该用户是否有附加的权限")
    @TableField(exist = false)
    private Integer addAuth;

    @ApiModelProperty(value = "企业内部最高管理员 0不是 1是")
    private Integer orgAdmin;

    @ApiModelProperty(value = "是否完全管理权限 0不是 1是")
    @TableField(value = "admin_flag")
    private Integer adminFlag;

    @ApiModelProperty(value = "设备池管理权限 0不是 1是")
    @TableField(value = "station_flag")
    private Integer stationFlag;

    @ApiModelProperty(value = "爬虫站管理权限 0不是 1是")
    @TableField(value = "crawler_flag")
    private Integer crawlerFlag;

    /**
     * 用户身份
     */
    @ApiModelProperty(value = "用户身份名称数组")
    @TableField(exist = false)
    private List<Map<String, Object>> role;

    /**
     * 用户身份
     */
    @ApiModelProperty(value = "用户身份名称数组")
    @TableField(exist = false)
    private  List<SysStationGroupVO> stationGroup;

    @ApiModelProperty(value = "用户任务所属客户(溯源任务归属)")
    private String taskOrgId;

}
